The memory included with computer systems typically includes a memory cache which comprises buffer storage that contains instructions and data frequently accessed by the processor in the system. Caches are typically constructed of cache lines which are boundaries between blocks of storage that map to a specific area in the cache. The cache lines are usually made up of a plurality of words having adjacent addresses.
Computer systems which include memory caches often support the concept of memory stacks. Stacks represent areas in memory which store temporary register information and return addresses of subroutines. The number of stacks which may be supported and the length of the stacks varies between systems.
Stacks permit POP read and PUSH write operations, also referred to as pushdown storage. The operation of the stack in POP and PUSH operations is a last-in-first-out type of operation, that is, the last word written (PUSHED) into the stack is the first word retrieved (POPPED) from the stack.
Many of the computers in use today, however, are register based and do not directly support stacks in hardware. These types of computers therefore implement memory stacks in software (application code), and most high level programming languages make use of stacks to support a variety of programming constructs.
The actual memory for storing the data which make up stacks is typically allocated on a stack-by-stack basis. Each stack is provided with a certain segment of the cache storage area which corresponds to that stack. In multi-tasking environments, individually operating programs may each involve operations to separate stacks. Accordingly, at any time during operation of a multi-tasking system, a plurality of stacks may be in existence. In multi-tasking environments which generate a large number of stacks, designating memory for each of the separate stacks can result in exhaustion of available cache space.
Accordingly, it is an object of the present invention to provide a cache design which supports execution of stack operations in a multi-tasking computer environment. It is a further object of the invention to provide such a stack cache design which permits each of a plurality of stacks of various sizes to be mapped to a common cache storage space, such that the cache design may be implemented using less memory than known designs.